function Environment() {
  this.rootPanel = null;
};

    /**
    * Starts application right after loading xml data defining controls. Registers
    * global variables used during mess app. lifetime.
    *
    * @public
    * @method  startApplication
    * @param   {DOM} xml controls representation
    */
    Environment.prototype.startApplication = function(xmlContent) {

        // build controls structure from incoming xml data
        var controls = this.buildControlsCollection(xmlContent);

        // register global variables
        this.registerGlobalVariables();
        
        // build root panel control (recursive)
        var panel = controls.get(0);
            panel.setParent(document.body);
            panel.build();
            panel.buildChildControls();
            panel.invalidate();

        // reset body && render root panel
        for (var i = 0; i < document.body.childNodes.length; i++) {
            document.body.removeChild(document.body.childNodes[i--]);
        }
        document.body.className = "messBody";
        document.body.appendChild(panel.render());
    };

    /**
    * Starts xml data parser, resposible for turning xml data into controls collection
    *
    * @private
    * @method  buildControlsCollection
    * @param   {DOM} xmlContent   xml data defining controls
    * @return  {List} controls collection
    */
    Environment.prototype.buildControlsCollection = function(xmlContent) {

        return new XmlDataParser(xmlContent).parse();
    };

    /**
    * Register global variables, necessary for proper application functionality
    *
    * @private
    * @method   registerGlobalVariables
    */
    Environment.prototype.registerGlobalVariables = function() {

        // garbage collector reference
        gc = new GarbageCollector();
        
        // event util reference
        eventUtil = new MessEventUtil();

        // env reference
        env = this;
    };

    Environment.prototype.getRootPanel = function() {
        this.rootPanel = Panel.prototype.objects.get("messPanel_0");
        Environment.prototype.getRootPanel = function() { return this.rootPanel; };

        return this.rootPanel;
    }

